﻿using System;
using System.Net;

namespace SuperCaptcha.Mvc.Processor
{
    internal sealed class SoundProcessor
    {
        internal string GetSoundBase64String(string text)
        {
            WebClient client = new WebClient();
            string address = "https://translate.google.com/translate_tts?ie=UTF-8&q=" + text + "&tl=en&total=1&idx=0&textlen=5&client=t&prev=input";
            byte[] soundBytes = client.DownloadData(address);
            return Convert.ToBase64String(soundBytes);
        }
    }
}
